﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public static class FuncExtension
    {
        public static Func<bool> Invert<T>(this Func<bool> func)
        {
            return () => !func();
        }

        public static Func<T, bool> Invert<T>(this Func<T, bool> func)
        {
            return (s) => !func(s);
        }

        public static Func<T1, T2, bool> Invert<T1, T2>(this Func<T1, T2, bool> func)
        {
            return (s1, s2) => !func(s1, s2);
        }

        public static Func<T1, T2, T3, bool> Invert<T1, T2, T3>(this Func<T1, T2, T3, bool> func)
        {
            return (s1, s2, s3) => !func(s1, s2, s3);
        }
    }
}
